import 'package:ayj_flutter_chat_app/common/third/agora/engine/agora_engine_controller.dart';
import 'package:flutter/material.dart';
import 'package:ayj_flutter_chat_app/common/configs/project_config.dart';


class VoiceTimeWidget extends StatefulWidget {
  final MeetingStatusType type;
  final ControllerType cType;

  const VoiceTimeWidget({
    super.key,
    required this.type,
    required this.cType,
  });

  @override
  State<VoiceTimeWidget> createState() => _VoiceTimeState();
}

/// 换绑手机-校验页面
class _VoiceTimeState extends State<VoiceTimeWidget> {

  @override
  Widget build(BuildContext context) {

    if(MeetingStatusType.call == widget.type){
      return Text('等待对方应答...',
        style: KStyles.commonFontWeightTextStyle(Colors.white, KDimens.font_sp15),);
    }
    if(MeetingStatusType.waiting == widget.type){
      if(widget.cType == ControllerType.meetingVideo){
        return Text('视频通话',
            style: KStyles.commonFontWeightTextStyle(Colors.white, KDimens.font_sp15));
      }
      return Text(' ');
    }
    if(MeetingStatusType.received == widget.type){
      return Obx(()=>Text(JhStringUtils.hms_dateFormatSeconds(AgoraEngineController.to.count.value),
          style: KStyles.commonFontWeightTextStyle(Colors.white, KDimens.font_sp15)));
    }

    return const SizedBox();
  }

}